package com.job.yangshida.homework0707.oop1;

/**
 * @author 杨士达
 * @version 1.0
 * @since 2022-07-08 17:33:34
 */
public class Student {
    //成员变量 每个成员都有一套 跟随对象在堆内存里 对象间互不干扰
    public int age;
    public String name;
    //成员方法 每个对象都可以调用的
    public int add2num(int a,int b){
        return a+b;
    }
    //类变量 类的特征 所有对象共享 用static修饰
    //count对象的个数
    public static int count;

    public Student() {
        count++;
    }

    public Student(int age) {
        this.age = age;
        count++;
    }

    public Student(String name) {
        this.name = name;
        count++;
    }

    public Student(int age, String name) {
        this.age = age;
        this.name = name;
        count++;
    }
    public Student(String name, int age) {
        this.age = age;
        this.name = name;
        count++;
    }

    public static void sayHello() {
        System.out.println("hello");
    }
}
